/**
 * TDEngine 3.0支持的数据类型
 * name isLength desc tag
 * 名称 可变长 描述 标签类型 可变长度默认都是8
 */
const TDENGINE_DATA_TYPES = [
  {
    name: "TIMESTAMP",
    isLength: false,
    desc: "时间戳",
    tag: false,
    isNumber: false,
  },
  { name: "INT", isLength: false, desc: "整型", tag: false, isNumber: true },
  {
    name: "INT UNSIGNED",
    isLength: false,
    desc: "无符号整型",
    tag: false,
    isNumber: true,
  },
  {
    name: "BIGINT",
    isLength: false,
    desc: "长整型",
    tag: false,
    isNumber: true,
  },
  {
    name: "BIGINT UNSIGNED",
    isLength: false,
    desc: "无符号长整型",
    tag: false,
    isNumber: true,
  },
  {
    name: "FLOAT",
    isLength: false,
    desc: "浮点型",
    tag: false,
    isNumber: true,
  },
  {
    name: "DOUBLE",
    isLength: false,
    desc: "双精度浮点型",
    tag: false,
    isNumber: true,
  },
  {
    name: "SMALLINT",
    isLength: false,
    desc: "短整型",
    tag: false,
    isNumber: true,
  },
  {
    name: "SMALLINT UNSIGNED",
    isLength: false,
    desc: "无符号短整型",
    tag: false,
    isNumber: true,
  },
  {
    name: "TINYINT",
    isLength: false,
    desc: "单字节整型",
    tag: false,
    isNumber: true,
  },
  {
    name: "TINYINT UNSIGNED",
    isLength: false,
    desc: "无符号单字节整型",
    tag: false,
    isNumber: true,
  },
  {
    name: "BOOL",
    isLength: false,
    desc: "布尔型",
    tag: false,
    isNumber: false,
  },
  {
    name: "JSON",
    isLength: false,
    desc: "JSON数据类型",
    tag: true,
    isNumber: false,
  }, //只有tag可以是json格式数据
  {
    name: "NCHAR",
    isLength: true,
    desc: "字符串",
    tag: false,
    isNumber: false,
  },
  {
    name: "VARCHAR",
    isLength: true,
    desc: "字符串",
    tag: false,
    isNumber: false,
  },
  {
    name: "GEOMETRY",
    isLength: false,
    desc: "几何类型",
    tag: false,
    isNumber: false,
  },
  {
    name: "VARBINARY",
    isLength: true,
    desc: "可变长的二进制类型",
    tag: false,
    isNumber: false,
  },
];
export function getTypeByName(name){
	return TDENGINE_DATA_TYPES.find(item=>item.name == name);
}
export { TDENGINE_DATA_TYPES };
